<script lang="ts" setup>
import { ref, onMounted } from 'vue'
import child from './components/child.vue';

const userPermissions = ['create', 'edit', 'delete'];
onMounted(() => {
  localStorage.setItem('userPermissions', JSON.stringify(userPermissions))
})

const data = ref('我是父组件传递给子组件的数据')

const message = ref('我是v-model的重命名信息')
</script>

<template>
  <el-button type="primary" size="small" v-permission="'create'">新增</el-button>
  <el-button type="primary" size="small" v-permission="'edit'">编辑</el-button>
  <el-button type="primary" size="small" v-permission="'delete'">删除</el-button>

  <div style="margin-top: 100px;display: flex; flex-direction: column;gap: 20px;">
    <el-button type="primary" style="width: 100px;" size="small">v-model测试</el-button>
    <child v-model="data" v-model:message="message"></child>
  </div>

</template>

<style scoped lang="scss"></style>